/**
 * 会员中心
 */
var app = getApp()
Page({
	data: {
		root:app.setting.att_url,
		pagedata:[],
		action: '',
		bannerHeight: Math.ceil(290.0 / 750.0 * getApp().screenWidth)
	},
	onPullDownRefresh: function (){
		var the=this;
		var opt={};
		the.onLoad(opt);
		setTimeout(function(){
			wx.stopPullDownRefresh()
		},1000);
	},
	onLoad: function (options){
		var the = this;
		wx.setNavigationBarTitle({
			  title: '绑定手机'
		}),
		app.util.get(app.access,function(pagedata){
			console.log(pagedata);
			the.setData({
				pagedata:pagedata,
				loading:false
			});
		});
	},
	change:function(){
		var the = this;
		the.setData({
			'pagedata.changemobile':1
		});
	},
	subpost:function(){
		var the = this;
		if(the.data.pagedata.item.mobile){
			app.util.message('绑定成功','','goback');
		}else{
			app.util.msg('请点击重新绑定，并绑定当前手机');
		}
		
	},
	mobile_login:function(e){
		var the = this;
		//根据openid为用户登陆，此处尝试获取用户手机号
		app.util.post('core/member.login/wxapp_login/return_mobile=1',e.detail,function(res){
			the.setData({
				'pagedata.item.mobile':res.mobile
			});
		});
	},
	click:function(evt){
		//用户点击事件 data.func 为方法名，data.params 为调用参数！
		var data=evt.currentTarget.dataset;
		//console.log(evt);
		app.util[data.func](data.params);
	}
})